class MembershipsController < ApplicationController

  before_filter :login_required

  def show
    render :nothing => true
  end

  def new
    @memberships = Membership
    @discipline = Discipline.find(params[:discipline_id])
    @membership = Membership.new(:user => current_user, :discipline => @discipline)

    if @membership.save
      flash[:notice] = "You have joined #{@discipline.name}"
    end
    redirect_to discipline_url(@discipline)
  end

end
